home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / i_l / jacosub / documentation / jscripts.doc < prev    next >
Text File  |  1995-12-30  |  50KB  |  984 lines

  1. JACOsub 2.4 SCRIPT FILE FORMAT SPECIFICATION
  2. ============================================
  3.  
  4. Here is the complete JACOsub script file format specification.
  5. It's not complicated (unless you want it to be) and quite flexible.
  6. Check out the sample script (demo.js) that came with this software;
  7. it demonstrates many of the things you can do with a script.
  8.  
  9. The accompanying file QuickRef.doc is a summary of this document, providing
  10. brief descriptions of the commands, escape codes, and directives that you
  11. can put into a script.
  12.  
  13. CONTENTS OF THIS DOCUMENT
  14. =========================
  15.  
  16.  1.  Basic format conventions
  17.  2.  Compiler commands
  18.  3.  Timed lines
  19.  4.  Directives (for controlling timed lines)
  20.  5.  Sample lines
  21.  6.  Credits
  22.  
  23. Most of the information in this document is demonstrated by the timed
  24. script demo.js, which is included in the JACOsub distribution archive.
  25.  
  26.  
  27. 1.  BASIC FORMAT CONVENTIONS
  28. ============================
  29.  
  30. 1.  Space characters (white space) may consist of spaces or tabs.  Any line
  31.     in a script file may contain any amount of white space in front of,
  32.     behind, or in between parameters or words.
  33.  
  34. 2.  A line cannot be more than 511 characters in length (but you can
  35.     concatenate several lines; see "escape codes" below).
  36.  
  37. 3.  Lines in the file may be blank lines, compiler commands, or timed
  38.     lines for the script.  All these are explained below.
  39.  
  40. 4.  Blank lines or lines containing white space only are ignored.
  41.  
  42.  
  43. 2.  COMPILER COMMANDS
  44. =====================
  45.  
  46. Any line where # is the first non-space character is treated as a compiler
  47. command.  The command is indicated by the next character or word (upper or
  48. lowercase) following the #.  Some commands have arguments, which are
  49. assumed to begin with the next non-whitespace characters following the
  50. command.  Anything shown here in square brackets [] are optional.
  51. The commands are:
  52.  
  53.    #       (followed by a space) Comment.  The line will be ignored.
  54.  
  55.            Example:
  56.            # This is a comment.
  57.  
  58.    #C[LOCKPAUSE] <time>
  59.            While a script is running, this command forces the clock to
  60.            pause the clock at the time specified by <time>.  Pressing a key
  61.            will resume play.  <time> is an offset from the beginning of the
  62.            script in the form H:MM:SS.FF (hours:minutes:seconds.units).
  63.            The beginning time of a script is usually 0:00:00.00 unless the
  64.            script was included with an offset using the #I command.
  65.  
  66.            This command is useful for titling multiple laserdisc sides in
  67.            a single script.  Be warned:  There will be no indication on the
  68.            screen telling you that the script is paused!  You have to keep
  69.            track of your pauses yourself.
  70.  
  71.    #D[IRECTIVE][n] <directive string>
  72.            Change some directive defaults (see the Directives section
  73.            below), as in:
  74.  
  75.            #DVB8C10    or    #directive3 hr50vmf2    or    #d9JLJBC
  76.  
  77.            This command affects only those lines following it.  Scripts may
  78.            contain as many #D commands as you like.
  79.  
  80.            There are 21 default directives available for you to set.
  81.            Specifying #D is the same as #D0 -- this sets the general
  82.            overall default directive when a title line contains no
  83.            directive or when just the D directive is present.  The
  84.            directives D1 - D20 may be set for situations when you need a
  85.            shorthand way to represent a long complicated directive string
  86.            in many places in your script.  Directives D0-D20 are initially
  87.            all identical, according to your DIRECTIVE config setting.
  88.  
  89.    #F[ONT] <n> <fontname.font> <size> [CLEAN or QUICK&DIRTY] [Y/X]
  90.            This command sets font <n> to <fontname.font> which is <size>
  91.            pixels high.  Font settings affect the entire script.  The <n>
  92.            argument may range from 0 to 9 if the software has been
  93.            registered, otherwise <n> may range from 0 to 3.  #F commands
  94.            should be specified before any timed lines in the script.
  95.  
  96.            CLEAN or QUICK&DIRTY indicate the rendering mode for the font.
  97.            Normally, you should NEVER need to set the rendering mode!  The
  98.            program is smart enough to determine the best mode.  Mono-color
  99.            fonts will always be QUICK&DIRTY, and color fonts will be CLEAN
  100.            only if the characters are designed to overlap.
  101.  
  102.            The Y/X argument modifies the default 1/1 aspect ratio for the
  103.            font's height vs. width.  It must be specified as two integers
  104.            separated by a slash with no spaces, as in 40/33.  This argument
  105.            works only in AmigaDOS versions 2.0 or higher.
  106.  
  107.            NOTE:  Due to the Amiga's internal font management, the Y/X
  108.            parameter will affect only those fonts having names and/or sizes
  109.            different from those fonts already loaded in memory.  For
  110.            example, the 36-pixel JACOsub font is loaded as font 0 when the
  111.            program starts up, and its aspect ratio will be whatever it had
  112.            when it loaded (see the FONT setting in the jacosub.cfg file).
  113.            Any attempt to assign "jacosub.font 36" a different aspect will
  114.            have no effect.  You can get around this by setting the program
  115.            configuration so that font 0 is something like Topaz 9,
  116.            rebooting, and then using your script to load jacosub.font 36
  117.            with the desired aspect ratio.
  118.  
  119.            Example: #F 2 Diamond.font 20
  120.  
  121.    #I[NCLUDE] <time> <filename>
  122.            Include another script file <filename> into the current script,
  123.            offsetting the second script's start time by <time>.  <time> is
  124.            always FORWARD offset.
  125.  
  126.            This command is useful, for example, if you are subtitling a
  127.            series of TV shows having subtitles for credits and ending song
  128.            lyrics.  Rather than importing and/or re-timing the same
  129.            sequences over and over again for each episode, you need only
  130.            time the song lyrics once and the credits once, with the times
  131.            starting at zero, and save these two scripts as separate files.
  132.            When your "main" script includes these other scripts, they will
  133.            be incorporated properly into the main script to start at the
  134.            proper time (which is <time> added to the first time event in
  135.            the included script), and any overlapping time ranges will be
  136.            interwoven properly.
  137.  
  138.            <time> is specified in the form H:MM:SS.FF, where H is an hours
  139.            digit, M is a minutes digit, S is a seconds digit, and F is a
  140.            fractional-second digit.  The units of F are determined by the
  141.            #T command (below), and default to 30 units/second if the #T
  142.            command was omitted (that is, the FF digits are SMPTE units
  143.            ranging from 00 to 29).  The included script may in turn contain
  144.            its own, possibly different, #T command, and also its own
  145.            #I commands.  <time> always offsets the "includee" relative to
  146.            the beginning of the "includer," taking into account the
  147.            "includer's" own offset if the "includer" was itself included by
  148.            some other script.
  149.  
  150.            <filename> may be any valid path + file name.  <filename> can
  151.            specify a complete path; if no path is specified then JACOsub
  152.            will look in the default scripts directory, which you can set in
  153.            the General Config menu.  If you omit the extension in
  154.            <filename>, then the program will include the script with the
  155.            most recent time-stamp, among the extensions .js, .tts, .pjs, or
  156.            .tim (.jsc, .pan, or .sub files won't be considered).  The file
  157.            name must not contain any spaces.
  158.  
  159.            Any occurrences of #F, #P, #Q, and #R in an included script will
  160.            be ignored.  These commands work only in the primary script, and
  161.            they affect all included scripts.  The effects of #D, #S, and #T
  162.            commands are passed down into included scripts, but these
  163.            commands inside an included script affect only that script and
  164.            others IT might include; they have no effect on the higher-up
  165.            "calling" scripts.
  166.  
  167.            Example: #I 0:21:44.16 scripts:kor/kor-credits.js
  168.  
  169.            On computers with small amounts of memory (1 megabyte or less),
  170.            you may find that the memory reallocation fragmentation that
  171.            occurs from having too many large included scripts may result in
  172.            a memory overflow error message.  If this happens, making your
  173.            largest script the root script should help.
  174.  
  175.    #P[ALETTE] <color> <r> <g> <b> [palette]
  176.            This sets the red, green, and blue intensities for color
  177.            register <color>, to <r>, <g>, and <b>, respectively.  This
  178.            command may be specified anywhere in the file, but the setting
  179.            will be used for the entire script.  Use intensities of 14 or 15
  180.            with caution, as these are stronger than normal video signals,
  181.            and can result in color bleeding when using in your genlocked
  182.            video signal.  Do not redefine color 2; JACOsub expects it to
  183.            remain black.
  184.  
  185.            The optional [palette] parameter defaults to 0, and indicates
  186.            the palette number in which to set the color.  JACOsub has 10
  187.            palettes available.  All 10 palettes are initialized to initial
  188.            values set in the Playing / video Config menu.  Palettes 1 - 9
  189.            may be used to reset temporarily certain colors for a particular
  190.            display, using the CP directive.  If JACOsub is using a
  191.            2-bitplane display, for example, you are restricted to 4 colors
  192.            at any one time, but using multiple palettes allows you to
  193.            redefine them on the fly.
  194.  
  195.            Examples:
  196.            #P1 14 14 6    # set color 1 to yellow, in default palette 0
  197.            #p 3 0 13 0 1  # set color 3 to green, in palette 1
  198.  
  199.    #Q[UANTIZE] [n]
  200.            This command has the effect of eliminating timing gaps between
  201.            subtitles of less than [n] time units, as specified by the #T
  202.            command.  Default is #Q0.  Example:  With #t30 and #q2
  203.            specified, any time event less than 2/30 seconds earlier than
  204.            another time event will be rounded up to the later event.  This
  205.            is of questionable usefulness.  If this command occurs before a
  206.            #T command, then 30 units per second is assumed.  Subsequent #Q
  207.            commands replace earlier ones.  Only the last #Q command in a
  208.            script has any effect.
  209.  
  210.    #R[AMP] <seconds.units>
  211.            If you play a pre-timed script, and discover a time drift, then
  212.            use this command.  The parameter <seconds.units> is the amount
  213.            of drift to correct over the entire script.  Script timings will
  214.            be adjusted appropriately according to this value.  A positive
  215.            value will lengthen the total script running time, and a
  216.            negative value will shorten the total script running time.  The
  217.            default value is #R0.  The number after the decimal point is NOT
  218.            a fractional second; it is the number of time units specified by
  219.            #T.  THIS COMMAND MUST NOT OCCUR BEFORE A #T COMMAND.  Examples:
  220.  
  221.            #R-3.60  will shorten the script running time 3 seconds plus 60
  222.                     time units.
  223.            #R .92   will lengthen the script running time 92 time units.
  224.  
  225.            IMPORTANT:  Your genlock affects the computer's internal clock.
  226.                        If you find that you have to ramp a 30-minute script
  227.                        more than 10 seconds, then you have a bad problem
  228.                        with your genlock.  DO NOT TRY TO "FIX" THE PROBLEM
  229.                        WITH A BIGGER RAMP TIME!  Doing so will result in
  230.                        math overflows, causing sudden jumps in timing.
  231.  
  232.    #S[HIFT] <[[hours:]minutes:]seconds.units>
  233.            The parameter <seconds.units> is the amount to shift each time
  234.            event in the script.  A positive value will delay each time, and
  235.            a negative value will advance each time.  The default value is
  236.            #S0.  The number after the decimal point is NOT a fractional
  237.            second; it is the number of time units specified by #T.  THIS
  238.            COMMAND MUST NOT OCCUR BEFORE A #T COMMAND.
  239.  
  240.            The first occurrence of #S in a script determines a global
  241.            amount of shift, even if the first #S appears AFTER some timed
  242.            lines.  Subsequent occurrences affect only those lines following
  243.            the #S.  You must take care that your #S commands do not cause
  244.            any times to be less than zero.  The Amiga uses unsigned
  245.            integers (always positive) for its internal representation of
  246.            times, meaning that a time "less than" zero is actually a very
  247.            large number!
  248.  
  249.            Example:  #S -0.20 will cause ALL events to occur 20 time units
  250.            sooner than usual, if this is the FIRST #S.  Otherwise, all
  251.            events SUBSEQUENT to this command will be shifted so that they
  252.            occur 20 units sooner.
  253.  
  254.    #T[IMERES] <n>
  255.            Time resolution; sets time units to <n> per second.  The default
  256.            is SMPTE units of 30 counts/second, as in #T30.  If your script
  257.            is in units 1/100 second units or PAL units, you must say so
  258.            with the appropriate command, before the subtitle text begins.
  259.            The #R or #S commands cannot precede a #T command.
  260.  
  261.            Examples:  #t100
  262.                       #TIMERES 25
  263.  
  264.  
  265. 3.  TIMED LINES
  266. ===============
  267.  
  268. Timed lines for the script may occur in any order.  They look similar to
  269. this:
  270.  
  271.    H:MM:SS.FF H:MM:SS.FF directive {comment} text {comment} more text...
  272.  
  273. For example:
  274.  
  275.    0:30:57.22 0:30:59:46 vm {opening credit} A Film By Akira Kurosawa
  276.  
  277. Here's what all those pieces are:
  278.  
  279. Start time and stop time
  280. ------------------------
  281. The first field is the time when the subtitle is to appear on the screen.
  282. The normal default is SMPTE format (that is, FF can range from 00 to 29).
  283. Use the #T command (described above) to define the units.  IMPORTANT: The
  284. FF digits represent time units, NOT fractions of a second.  There is a
  285. difference!  For example, if you use #T10 to specify 1/10 second time
  286. units, then a time such as 0:00:00.60 would be illegal (and result in an
  287. error) because it specifies 60 time units!  0:00:00.6 or 0:00:00.06 or
  288. even 0:00:00.00006 would be correct for this case -- 6 UNITS are specified,
  289. not 6 tenths of a second.
  290.  
  291. The second field is the time when the title is to disappear.
  292.  
  293. If you prefer, you do not have to use the H:MM:SS.FF format at all.
  294. Instead, you can substitute a @ symbol followed by a single integer to
  295. represent total time units.  For example, if #T30 is used to specify 1/30
  296. second units, then the 0:05:10.22 is the same as @9322.  This format is
  297. useful for representing times as video frame counts.  Many laserdisc
  298. players display times in this fashion.
  299.  
  300. Directive string
  301. ----------------
  302. The next field is the directive.  It is optional.  If you leave it out, the
  303. program will default to standard subtitling form (all text centered at the
  304. bottom of the screen or depending on how you have your global default
  305. directive set in your configuration).  The title text MUST begin with a
  306. non-alphabet character {such as a comment} if you omit the directive.
  307. Directives are explained fully in the DIRECTIVES section below.  The first
  308. non-whitespace character following  the directive is assumed to be the
  309. beginning of the subtitle text.
  310.  
  311. Inline comments
  312. ---------------
  313. The {comment} is considered a part of the subtitle text, but it is ignored
  314. by the software.  Use it for character names or keywords.  A comment must
  315. be enclosed in braces.  Comments may appear anywhere within the text of a
  316. subtitle.  If you really want to to display a left brace, precede it with a
  317. backslash like so: \{.  Right braces will be interpreted as a literal
  318. character or close of a comment, whichever seems appropriate.  If a
  319. whitespace character immediately follows a comment closing brace, then that
  320. first whitespace character will be ignored.  Any other kind of following
  321. character will be considered part of the subtitle text, and used.  Comments
  322. in the text are especially useful when translating foreign films -- we use
  323. them to list possible translations of phrases we are not yet sure about.
  324.  
  325. Title text
  326. ----------
  327. In the example above, the "text" and "more text" fields are what get
  328. displayed.  There are several special codes that you can put inside the
  329. text (CASE IS IMPORTANT HERE ONLY):
  330.  
  331.    \    Concatenate.  If the LAST character in a line is a backslash, then
  332.         JACOsub will concatenate the text on the next line to the text
  333.         in the current line.  Leading and trailing whitespace will be
  334.         stripped from the concatenated text, so you can indent it if you
  335.         wish.
  336.  
  337.    \n   Newline.  This is like a carriage return.  A line containing this
  338.         code will be split at the \n.  Each of these new fragments will
  339.         then be wordwrapped separately unless you turn wordwrapping off
  340.         (see the W directive below).  \n is useful for general formatting.
  341.         Multiple \n codes may be concatenated to create blank lines.
  342.         Example:  Hello!\n\nHow are you?{blank line separating the two}
  343.  
  344.    \{   Display a left brace.  Left braces are normally used to indicate
  345.         the beginning of a comment.
  346.  
  347.    \~   Display a tilde.  Tildes are normally used to create "hard" spaces
  348.         (see below).
  349.  
  350.    \\   Display a backslash.  Backslashes are normally used to denote these
  351.         special codes.
  352.  
  353.    \N   Normal.  All text appearing after this code will be displayed in
  354.         "normal" style.  This is typically the default, unless you have the
  355.         style (S) directive set to something other than normal.  Note that
  356.         this code is an uppercase \N -- a lowercase \n is a newline code.
  357.  
  358.    \I   Italics.  Display all text appearing after this code in italics.
  359.         Example:  \IHello!\N\nHow are you?{Hello is in italics}
  360.  
  361.    \B   Boldface.  This one isn't particularly useful, but go ahead if you
  362.         feel like it.  Text characters will be slightly fatter.
  363.  
  364.    \U   Underline.  This is virtually useless for large color text.
  365.  
  366.    \Cn  Color n.  The text following this code will be displayed using face
  367.         color n.  n is a hexadecimal digit; it may take the values 0-9 or
  368.         A-F (or a-f).  Typically, when using the font supplied with this
  369.         software on a 2-bitplane display, only colors 3 and 1 are useful.
  370.         See the CF directive below for some caveats about colors.
  371.  
  372.    \Fn  Font n.  The text following this code will be displayed using font
  373.         number n.  n may range from 0 to 9 (or 0 to 3 if the program is
  374.         not registered).  Normally you would use the F directive to set the
  375.         default font for a line; use this escape code to override it.
  376.  
  377. THE LAST 6 CODES ABOVE AFFECT ONLY ONE TIMING LINE; their effects do not
  378. carry over into other lines.  These codes override any directives.  The \I,
  379. \B, and \U codes are mutually exclusive:  You can have bold text or italic
  380. text, but you cannot create text that is BOTH bold and italic.  See the 
  381. demo script file (demo.js) for good examples on usage.
  382.  
  383. Leading or trailing space in subtitle text will be ignored.  If you want to
  384. encode a true space on the ends of some text, use a tilde (~).  It will be
  385. displayed as a space.  To actually display a tilde, precede it with a
  386. backslash: \~.  Tildes may also be used to create "hard"spaces; they will
  387. be displayed as spaces but text will not be wordwrapped on these spaces.
  388.  
  389. White space between line arguments may consist of any amount of spaces or
  390. tabs.  Each tab character inside the subtitle text will be converted to a
  391. space character.
  392.  
  393.  
  394. 4.  DIRECTIVES
  395. ==============
  396.  
  397. Directive strings were briefly described above, but there are so many that
  398. they deserve to be allocated a whole section of this document.
  399.  
  400. A directive is a series of character codes strung together.  A directive
  401. determines a subtitle's position, font, style, color, and so forth.  Each
  402. character code begins with an alphabet character followed by arguments made
  403. up of other alphabet characters and numbers.  Directives may contain any of
  404. the following codes, in any order.  The directives may be uppercase or
  405. lowercase.  Like the text codes above, directives only affect a SINGLE
  406. timing line; their effects do not carry over into other lines.  Any
  407. parameters shown here in square brackets [] are optional.
  408.  
  409. Vertical positioning
  410. --------------------
  411.  
  412.     VA     Continue this line directly Above the previous one.  This is
  413.            the opposite behavior of VU below.  This is a useful directive
  414.            for those cases where you want a new line to appear above the
  415.            previous line's position, even if both lines do not share the
  416.            same time range.  See VU below for more details.
  417.  
  418.     VB[n]  Bottom.  Position last line at the bottom (default).  The offset
  419.            from the bottom of screen n is optional  - it says how many
  420.            raster lines to offset from the physical bottom-of-viewport.  VB
  421.            by itself is the same as VB16 (in the original default for this
  422.            software).  The default value of n can be changed using #D
  423.            command or in the General Configuration settings.
  424.  
  425.     VHn    Line height (i.e. spacing), where n is the percentage of the
  426.            font height to use for line spacing.  Default is 100 (single-
  427.            spaced).  Using 200 would result in double-spaced lines.  n may
  428.            range from -32768 to 32767, although the useful range is
  429.            probably more like 50 to 500.
  430.  
  431.     VL[n]  line n. Position subtitle starting at text line n (the height
  432.            of a line depends on the font you use).  n=0 is the top line.
  433.            If n is negative or omitted, the line will appear in the same
  434.            vertical position as the preceding timed line.
  435.  
  436.     VM[n]  Middle.  Text will be centered vertically in the area defined by
  437.            the VTn and VBn directives.  The optional parameter [n] is a
  438.            positive or negative integer that will cause the centered block
  439.            to be shifted up or down [n] lines (line height determined by
  440.            the VH setting).
  441.  
  442.     VPn    Pixel n. Position subtitle so that the font baseline of the
  443.            first line of text is n pixels from the top of the viewport.
  444.            You need to know your font's baseline position for this
  445.            directive to be of any use.  The mouse-positioning operation in
  446.            the script editor creates directives like this.
  447.  
  448.     VSn    Not yet implemented; doesn't do anything yet.  Don't ask.
  449.  
  450.     VT[n]  Top.  Position the title with the first line at the top.  The
  451.            offset n is optional - as with VB, VT by itself is the same as
  452.            VT16 in the original distribution of this software.
  453.  
  454.     VU     Continue this line directly Underneath the previous one.  This
  455.            is useful if you want a line with different directives grouped
  456.            in the same vertical-positioning block as the previous line.
  457.            You can also use the VU directive to create interesting effects
  458.            when a line with the VU directive is timed so that it is not on
  459.            the same display as the previous line.  For example, suppose you
  460.            had a single line that used the VM directive.  Normally it would
  461.            be perfectly centered vertically on the screen.  However, if a
  462.            VU line follows it, both are positioned as if they were a block
  463.            of lines to be centered on the screen together; i.e. the VM line
  464.            will appear slightly above center and the VU line will appear
  465.            slightly below center, regardless of WHEN they are individually
  466.            displayed.  Had VB been used instead of VM, the first line would
  467.            have appeared raised one text line higher than bottom, just
  468.            enough to make room for the second line.  VA has the same effect
  469.            as VU if the lines were in reverse order in the script.
  470.  
  471. Horizontal positioning
  472. ----------------------
  473.  
  474.   Margins:
  475.  
  476.     HLn    Left margin.  Set left margin at a position that is n% of the
  477.            the screen width.  Default is HL1 (1% from left edge).
  478.  
  479.     HRn    Right margin.  Set the right margin at a position that is n% of
  480.            the screen width.  Default is HL99 (1% from right edge).  The
  481.            right margin MUST be greater than the left margin.
  482.  
  483.   Text justification:
  484.  
  485.     JC     Center.  Text is centered within H constraints (normal default).
  486.  
  487.     JF[:p] Full.  This aligns the left and right edges of text flush with
  488.            the ends of the widest wordwrapped line in the text block.  If
  489.            you want the justified text to span the full margin width, set
  490.            wordwrapping to W2 (greedy) instead of W1 (smart, the default).
  491.            The :p is a position parameter.  It may be :C (default), :L, :R,
  492.            or :U, for Center, Left, Right, and Unconditional, respectively.
  493.            :C, :L, and :R control the position of non-wordwrapped lines
  494.            such as single short lines or the last line in a wordwrapped
  495.            block -- these will not not be stretched to fit the block width.
  496.  
  497.            The :U parameter means "unconditional."  JF:U is the same as JU.
  498.            JF:U causes ALL lines in the block, wordwrapped or not,
  499.            including the last line, to be stretched to fit exactly within
  500.            the margins.  JF:U is useful for titling credits like this:
  501.  
  502.                   Clint Eastwood . . . . . . . Dirty Harry
  503.  
  504.            All the spaces will then be adjusted so that the line fits
  505.            exactly inside the margins, and a list of these credits will
  506.            have flush left and right edges.  You will need to experiment
  507.            with the number of dots and spaces to get it all to look good.
  508.            You can also try elminating the spaces between the dots, or
  509.            substituting dashes, for somewhat different effects.
  510.  
  511.            JF[:p] commandeers one character in each font for use as an
  512.            adjustable space; the decimal character code used will be one
  513.            of: 128, 31, or 127, whichever is available (hex codes 80, 1F,
  514.            or 7F, respectively).  The JF directive has no effect on fonts
  515.            lacking all of these character codes.  Mono-spaced fonts are
  516.            likewise unaffected.
  517.  
  518.     JL     Left.  Align left edge of text at the HLn margin position.
  519.  
  520.     JR     Right.  Align the right edge of text at the HRn margin position.
  521.  
  522.     JU     Obsolote directive, identical to JF:U
  523.  
  524.   Block justification:
  525.  
  526.     JBC    Justify block center.  Because of wordwrapping, the width of a
  527.            text block will never occupy the full width specified in your
  528.            margin settings.  This directive positions the imaginary
  529.            rectangle occupied by the text in the center of your margin
  530.            settings, regardless of the text justification directives.  For
  531.            example, the JL directive by itself might produce the following
  532.            effect (the | character indicates margin boundaries):
  533.  
  534.            | The quick brown fox                      |
  535.            | jumped over the lazy dog.                |
  536.  
  537.            but the JL directive together with JBC will preserve the text
  538.            justification but center the block of text between the margins:
  539.  
  540.            |        The quick brown fox               |
  541.            |        jumped over the lazy dog.         |
  542.  
  543.            AnimEigo video products have their subtitles displayed this way.
  544.  
  545.     JBF    Justify block full (default).  Text will be positioned according
  546.            to whatever text justification directives are in effect, using
  547.            the full width specified by the current margin settings.
  548.  
  549.     JBL    Justify block left.  Position the text block at the left margin.
  550.  
  551.     JBR    Justify block right.  Position the text block so that the right
  552.            edge is at the right margin.
  553.  
  554.   Wordwrapping:
  555.  
  556.     W0     Disable automatic wordwrapping.  This may result in your text
  557.            not fitting within the position constraints defined with H & V.
  558.            There is really NO reason at all why you would want to turn off
  559.            wordwrapping; you can wrap words manually with the \n code
  560.            whether wordwrapping is on or off.  This directive is here just
  561.            for the sake of completeness.
  562.  
  563.     W1     Automatic "smart" wordwrapping (default).  Even if a your text
  564.            contains newline codes, the separate substrings will be word-
  565.            wrapped if necessary.  This wordwrap mode uses a "smart"
  566.            algorithm that attempts to minimize the area of the screen
  567.            occupied by the title.  In this mode, you will never see a line
  568.            wrapped as shown (the | characters indicate margin boudaries):
  569.  
  570.            | The quick brown fox jumped over the lazy |
  571.            |                   dog.                   |
  572.  
  573.            Instead, the W1 alghorithm will attempt to minimize the text
  574.            area without using any extra lines, resulting in:
  575.  
  576.            |           The quick brown fox            |
  577.            |        jumped over the lazy dog.         |
  578.  
  579.            This is easier for the viewer to read.  Same margins, same
  580.            number of lines, but the lines are more equal in length.
  581.  
  582.     W2     Automatic "stupid" (generally known as "greedy") wordwrapping.
  583.            If you are disconcerted by words not completely filling the
  584.            horizontal margin space, and you don't mind having a single word
  585.            hanging by itself on the last line (as in the first W1 example
  586.            above), then use this directive.  This is the standard
  587.            text-editor wordwrap algorithm, which makes no attempt at
  588.            aesthetics.  Why anybody would want to use this is beyond me,
  589.            but here it is.  \n codes behave the same as with W1.
  590.  
  591. Fonts
  592. -----
  593.  
  594.   Font rendering:
  595.  
  596.     Fn     Use font n, where n is a number from 0 to 9 (JACOsub loads
  597.            four fonts, which you can specify in the Config menu.  The usual
  598.            default font is 0, which is what you should use as your
  599.            "primary" font.  Fonts 4-9 are unavailable if the software is
  600.            unregistered.
  601.  
  602.     FQ     Quick&Dirty text.  Text color 3 is always quick.  Other colors
  603.            must normally be rendered one character at a time to avoid
  604.            interference between the shadow and face color, but only when
  605.            the font is designed with overlapping characters.  This
  606.            interference happens because of a fault in the way the Amiga
  607.            renders text.  The FQ directive forces all text on a line to be
  608.            rendered in quick mode as if it were color 3.
  609.  
  610.            You should never need to use the FQ directive.  The program is
  611.            smart enough to determine when a font can be quick&dirty.  For
  612.            example, JACOsub's 32- and 36-pixel fonts will default to clean
  613.            mode because they have overlapping characters, but the 32-pixel
  614.            font will default to Quick&Dirty because its characters do not
  615.            overlap.
  616.  
  617.     FC     Clean rendering.  Only color 3 will be rendered fast, other
  618.            colors will be rendered so that the face color is not disturbed.
  619.            You can use this directive to negate, on a single line, a global
  620.            FQ directive set using the #D command.  Normally this directive
  621.            will never be needed.
  622.  
  623.            The demo script demo.js tricks JACOsub into generating "slow"
  624.            clean text in the foreground display so you can see how it is.
  625.            If you are curious to see how the Amiga messes up color 1 text
  626.            if it's displayed the quick way, run the demo after inserting
  627.            the global command #DFQ at the top of the file demo.js before
  628.            you play the demo.
  629.  
  630.     FD     Default text rendering.  Rendering will be "quick" or "clean"
  631.            depending on how your font was set up in your configuration.
  632.            This directive is useful for overriding a #DFC or #DFQ command.
  633.  
  634.     FOn[:a]  Generate an outline around the font, n pixels wide.  Color 2
  635.            (JACOsub's outline color) is used to generate the outline.  This
  636.            directive is useful for transforming a plain mono-color Amiga
  637.            font into a nice titling font, especially when combined with the
  638.            FS (font shadow) directive.  Recommended value for n is 2, which
  639.            produces a nice flicker-free outline.  n must be less than 127.
  640.            The default value is zero.
  641.  
  642.            The optional :a suffix indicates a color to use for anti-
  643.            aliasing.  This defaults to the anti-alias setting in the
  644.            Playing / video configuration, typically 2 (no antialiasing).
  645.  
  646.            WARNING:  Generating outlines can slow the program down
  647.            considerably!  It is recommended that you use this directive
  648.            only with QUICK&DIRTY font rendering, preferably with mono-color
  649.            fonts.  An antialias color other than 2 will slow it down
  650.            somewhat further.
  651.  
  652.     FSdn   Generate a font shadow, taking into account any existing font
  653.            outline, in direction d, and n pixels deep.  Color 2 (JACOsub's
  654.            shadow color) is used to generate the shadow.  The direction d
  655.            is specified as a compass direction: N, S, E, W, NW, NE, SW, SE.
  656.            Good values to use for the shadow depth n are 2 - 5.  The
  657.            warning about font outlines above applies here also.
  658.  
  659.            Example: FSSE3 produces a shadow similar to the JACOsub 32-
  660.            pixel font, with the shadow extending down and to the right.
  661.  
  662.   Font style (may also be set with \ codes in the title text):
  663.  
  664.     SN     Normal style (typical default).
  665.  
  666.     SI     Italic.
  667.  
  668.     SB     Bold (using the JACOsub font, this doesn't look good with colors
  669.            other than color 3).
  670.  
  671.     SU     Underline (ugly!  Not recommended).
  672.  
  673.   Font color (CFn may also be set with text codes):
  674.  
  675.     CFn    Use color register n for the face color of the font.  JACOsub
  676.            assumes that all color fonts use bitplane 0 (i.e. color 1) for
  677.            the face color, and bitplane 1 (i.e. color 2) for the shadow/
  678.            outline.  THIS IS IMPORTANT!  JACOsub will generate text
  679.            differently depending on the color selected (see FF above).
  680.            The foreground color may also be set using the \Cn code inside
  681.            the text.
  682.  
  683.     CBn    Use color register n for the background color.  The display
  684.            will be cleared to this color prior to building the text.  If
  685.            two lines share the same display, and they have different
  686.            background colors specified, the screen will be cleared using
  687.            the latest NON-ZERO background color that occurs for that
  688.            display.  In other words, non-zero colors override the default
  689.            zero (transparent) background color.
  690.  
  691.     CPn    Use color palette n for this display.  Default value of n is 0,
  692.            which is the primary color palette normally used by JACOsub.
  693.            The values of n may range from 0 to 9, for a total of 10 color
  694.            palettes.  All 10 palettes are initially set to a master palette
  695.            which can be modified in the Playing / video Config menu, and
  696.            they can be modified with the #Palette script command.
  697.  
  698.            Because the palette is loaded immediately following a video
  699.            buffer switch, the new imagery on the display will appear with
  700.            the old palette momentarily.  If this is too noticeable, then
  701.            you should precede your alternate-palette lines with a "dummy"
  702.            short-duration blank screen (containing a hard space) using your
  703.            alternate palette, as in this example:
  704.  
  705.            0:00:12.20 0:00:12.22 cp2 ~{palette 2 on blank screen, .02 sec}
  706.            0:00:12.22 0:00:14.50 cp2 This will appear with the new palette.
  707.  
  708.     CS[L]n[:s[:c]] This causes text to appear inside a shaded rectangle.
  709.            The rectangle will be large enough to contain the text with a
  710.            margin of n pixels on all sides.  The shading is user-defined
  711.            (see the Playing / video Config menu) if s=0, or solid if s=1.
  712.            Color c will be used for the rectangle.  The style (s) and color
  713.            (c) paramters are optional; not setting them uses the defaults,
  714.            normally s=0, c=2 (user-defined, black).
  715.  
  716.            Setting n=0 disables the shading.  We suggest using n=8 or more.
  717.            Without the [L] parameter described below, only ONE shaded
  718.            background rectangle will appear on the screen; that is, JACOsub
  719.            will attempt to create a SINGLE box which contains ALL text that
  720.            uses the CS directive and shares the same display.  If two
  721.            shading directives for the same time range have conflicting
  722.            parameters, one of the directives will be used, but predicting
  723.            WHICH one is impossible.  The normal default setting is CS0:0:2,
  724.            which can be changed using the #D command.
  725.  
  726.            The optional [L] parameter causes each text segment (which might
  727.            be split by wordwrapping) to be shaded in its own rectangle.
  728.            This looks ugly for a block of wordwrapped text, but it is
  729.            useful for shading separate single lines that overlap in time.
  730.  
  731.            Notes:  Setting VB0 will mean that bottom-positioned text is as
  732.            low as it will go, therefore shading cannot appear below it.
  733.            You should set the VB directive so that there is room for the
  734.            shading rectangle to extend below the text.  Also, VB text will
  735.            be repositioned slightly higher when the running clock is
  736.            displayed during play, but shade boxes will NOT be repositioned.
  737.  
  738. Genlock fader control
  739. ---------------------
  740.  
  741.     GBn[Tm] Move the background slider control to n% saturation over a time
  742.            period of m/60 seconds of time.  n may range from 0 to 100.  If
  743.            time specifier is omitted, it defaults to 0 (i.e. instant).
  744.            Zero saturation is a normal transparent background, allowing the
  745.            video signal to show through all areas corresponding to color 0
  746.            on the computer's display.
  747.            Example:  GB63T120 slides the background fader to 63% saturation
  748.            in 2 seconds (120/60 seconds).
  749.  
  750.     GGn[Tm] Move the graphics slider control to n% saturation over a time
  751.            period of m/60 seconds of time.  100% saturation is the normal
  752.            operating mode (full graphics), whereas 0% results in only the
  753.            video signal with no overlaid computer graphics.
  754.  
  755.         >> DO NOT USE GG OR GB IN DEFUALT DIRECTIVES, or the genlock will
  756.            be having control signals sent to it at every time event.
  757.  
  758. IFF graphic files
  759. -----------------
  760.  
  761.       IL <ILBM file name> [<x offset %> <y offset %>]
  762.            Load an IFF ILBM file (typically a brush file) into a video
  763.            buffer for the time interval specified by the start and stop
  764.            time.  When this directive appears, JACOsub assumes that the
  765.            remainder of the line is information about the file, NOT title
  766.            text.  The file name must follow the directive string.  The
  767.            position to display the image, specified as percent of screen
  768.            width and height from the center, can be specified in the next
  769.            two fields.  These position coordinates default to 0 0 if they
  770.            are omitted, which results in the picture being centered on the
  771.            screen.  The picture may be positioned to extend beyond the
  772.            display edge.
  773.  
  774.            Any IFF ILBM picture or brush may be specified.  As many as
  775.            40 images may be loaded onto a single screen.  This enables you
  776.            to create several small brushes and display them all at once, in
  777.            different areas of the screen.
  778.  
  779.            CAVEATS (READ CAREFULLY!):
  780.            1.  You need at least AmigaDOS 2.0 to use this directive.  Under
  781.                1.3 and below, this directive is ignored unless you have a
  782.                1.3-compatible version of iffparse.library in your libs:
  783.                directory.
  784.            2.  You will not be informed if a file is too big to fit in
  785.                memory.  If this happens, the file will simply not load.
  786.            3.  If the IFF file contains more bitplanes than the JACOsub
  787.                video buffers, the EXTRA BITPLANES WILL BE IGNORED.  You may
  788.                change the number of JACOsub's bitplanes in the
  789.                Playing / video Config menu.
  790.                If you have JACOsub set for a 4-color (2-bitplane) screen,
  791.                and you try to load in a 16-color (4-bitplane) picture, you
  792.                will lose 2 biplanes of information, and the picture will
  793.                look strange when it appears.
  794.            4.  All pictures are treated as IFF brushes.  Therefore, your
  795.                picture, once loaded, will use JACOsub's color palette.  THE
  796.                PICTURE'S OWN COLOR PALETTE WILL BE IGNORED.  Create your
  797.                graphics using the SAME palette you use with JACOsub or the
  798.                picture will look strange when it appears.  If you want to
  799.                load a picture with its own colors, use the IS directive
  800.                (but then you won't be able to display text on top of it).
  801.            5.  JACOsub attempts to load the IFF files as they are needed.
  802.                This can cause a slight video switch delay if a time event
  803.                occurs while a file is loading, even though the IFF loading
  804.                routines do check the clock frequently.  Keep your IFF
  805.                images on a fast hard disk, or better yet, in RAM:.  If you
  806.                do not have sufficient memory, then do not use this
  807.                directive!
  808.  
  809.       IS <ILBM file name>
  810.            Load an IFF ILBM file into its own screen, with its own
  811.            resolution and colors.  This screen will temporarily replace
  812.            one of the video buffers.  As with IL, JACOsub assumes that the
  813.            text following the IS directive contains the file name to load.
  814.            JACOsub will attempt to center the picture on your screen.
  815.  
  816.            The IL caveats 1, 2, and 5 above apply here also, and the IS
  817.            directive has some additional considerations:
  818.  
  819.            1.  You cannot display text on top of a picture loaded with
  820.                the IS directive.  Use the IL directive for this.
  821.            2.  The time ranges associated with an IFF screen should NOT
  822.                overlap any other time ranges.  If they do, the start time
  823.                for the IFF file has priority over any unrealized end times.
  824.            3.  The IS directive can tax your memory even more severely than
  825.                the IL directive, especially if you load a pictures like
  826.                hi-res HAM images to substitute every video buffer.
  827.            4.  We observe difficulty loading Extra-Halfbrite pictures.
  828.                Try it for yourself.  HAM and AGA images seem to work OK.
  829.  
  830.         >> DO NOT USE IS OR IL IN DEFAULT DIRECTIVES!
  831.  
  832. ARexx communications
  833. --------------------
  834.  
  835.       RX <ARexx script name>
  836.            Execute the ARexx script name that follows the RX directive.
  837.            You should not specify other directives on the same line.  Only
  838.            one RX directive may be specified per time event -- that is, if
  839.            you have several lines all sharing the same start time, no more
  840.            than one of them may contain an RX directive.  If more than one
  841.            RX directive is specified for a given start time, the one that
  842.            occurs latest in the script will be used.  The end time for the
  843.            line is ignored, but should be larger than the start time to
  844.            avoid a compiler warning.  Try to make the end time equal to the
  845.            next nearest start time to avoid creating unnecessary video
  846.            frames.
  847.  
  848.         >> DO NOT USE RX IN DEFAULT DIRECTIVES!
  849.  
  850. Default directives
  851. ------------------
  852.  
  853. Because all of the above directives are optional, there is one other set of
  854. directives that may be used when you do not wish to specify any:
  855.  
  856.     D or D0   Default.  To be used if no other directives are used.  You
  857.            don't even need this directive at all, if your text begins with
  858.            a non-alphabetic character (such as a {comment}, number, etc.).
  859.  
  860.            Specifying D (or nothing) will use the program's default
  861.            settings.  The default directive for JACOsub is normally
  862.  
  863.            HL1HR99VH100VT16VB16JCJBFW1F0FDFO0:2FSSE0SNCF3CB0CP0CS0:0:2
  864.  
  865.            which you can change in the file JACOsub.Config, or with a #D
  866.            command at the top of your script.  Confused?  Here they are
  867.            spaced out:
  868.  
  869.            HL1 HR99 VH100 VT16 VB16 JC JBF W1
  870.            F0 FD FO0:2 FSSE0 SN CF3 CB0 CP0 CS0:0:2
  871.  
  872.            The IFF directives and the Genlock directives should NEVER be
  873.            specified globally, nor in JACOsub.Config.
  874.  
  875.     Dn     The directives D1 - D20 may be defined with the commands
  876.            #D1 - #D20.  You can use these "default" directives as shorthand
  877.            for more complex directives that you may need in many places.
  878.            If you put two D directives in the same directive string, the
  879.            latest one will be used, and any previous directives ignored.
  880.  
  881. If a directive string contains conflicting information, the information
  882. occurring last will be used.  For example, VTD will cause VT to be ignored
  883. in favor of the default.  In the directive CF10JLCF3, CF10 will be ignored
  884. in favor of CF3.  Naturally, any directive beginning with D is unaffected
  885. by the D.  In the long default directive above, you can see VT16VB16.  This
  886. serves to set the top-of-screen offset to 16 for later, and then sets the
  887. default vertical positioning will be 16 pixels from the bottom of the
  888. viewport.
  889.  
  890. Time track
  891. ----------
  892.  
  893.     Tx     Designate this line as belonging to track x, where x is any of
  894.            the characters 0-9, A-F (case insensitive), or punctuation.
  895.            This directive is ignored when compiling and playing scripts.
  896.            All titles default to T0 if no track is specified.
  897.  
  898. The purpose of tracks is to let you assign unique designations to specific
  899. title sequences interwoven with others in your script so that you can time
  900. them separately.
  901.  
  902. For example, suppose you need to subtitle two people talking simultaneously
  903. with music lyrics in the background.  This requires three independent
  904. timing sequences.  There are two ways to do this:
  905.  
  906. 1.  Separate blocks of titles.  Without using the T directive, you must
  907.     arrange each sequence as a separate block of titles (remember, JACOsub
  908.     doesn't care about order of the titles in your script file -- it will
  909.     sort everything out according to start and stop times).
  910.  
  911. 2.  One block of titles containing designated time tracks.  You can weave
  912.     all the titles together as one long sequence, and designate separate
  913.     tracks with the T directive so that the timing procedure can figure out
  914.     which titles must be timed, and which must be skipped.
  915.  
  916. TRACKS WILL BE IGNORED IN ALL DEFAULT OR USER-DEFINED DIRECTIVES.
  917. Furthermore, as far as JACOsub is concerned, it's not treated as a true
  918. "directive" at all.  Its only use is to flag lines for the program's timing
  919. functions.
  920.  
  921.  
  922. 5.  SAMPLE LINES
  923. ================
  924.  
  925. These 4 lines all have the same effect.  Note that any spaces after the
  926. directive and the first space after comments are ignored.
  927.  
  928. 0:00:10.11 0:00:12.00 D  {fudo-ikiteru} It's alive!
  929. 0:00:10.11 0:00:12.00 D  {fudo-ikiteru}It's alive!
  930. 0:00:10.11 0:00:12.00 D  It's alive!{line doesn't start with a comment}
  931. 0:00:10.11 0:00:12.00    {fudo-ikiteru} It's alive!{starts with a comment}
  932.  
  933. If you want leading/trailing spaces, all of these lines will do the same
  934. thing (put two spaces in front of and after the text):
  935.  
  936. 0:00:10.11 0:00:12.00 D  ~~{fudo-ikiteru} It's alive! ~
  937. 0:00:10.11 0:00:12.00 D  {fudo-ikiteru}~~It's alive!~~
  938. 0:00:10.11 0:00:12.00 D  {fudo-ikiteru} ~~It's alive!~~
  939. 0:00:10.11 0:00:12.00 D ~ It's alive!~~
  940. 0:00:10.11 0:00:12.00 ~~{fudo-ikiteru} It's alive! ~
  941. 0:00:10.11 0:00:12.00  {fudo-ikiteru}~ It's alive!~~
  942. 0:00:10.11 0:00:12.00  {fudo-ikiteru} ~~It's alive!~~
  943. 0:00:10.11 0:00:12.00  {fudo-ikiteru}   It's alive!~~
  944.  
  945. THE FOLLOWING LINE IS BAD.  It needs either a directive after the timing
  946. numbers, or a comment to indicate that subtitle text follows the timing
  947. numbers.  Any alphabet character (A-Z, a-z) following the timing numbers
  948. MUST be part of a directive.
  949.  
  950. 0:00:10.11 0:00:12.00  It's alive!
  951.  
  952. For the next line, use color 1 for the font face color, start the
  953. subtitle at the top of the screen and leave the other defaults alone,
  954. and cause one word to be displayed in italics:
  955.  
  956. 0:02:23.23 0:02:25.01 cf1vt {thug1-nani} Whaddaya \Imean\N, ``please?''
  957.  
  958. Note:  Normal quotation marks ("like this") may be used, but using a
  959. double grave and a double apostrophe, as in the line above, looks more
  960. professional on the screen.  Just make sure that the grave looks like an
  961. upside-down apostrophe in your font, and that both characters occupy a
  962. narrow space.  The JACOsub fonts are designed this way.
  963.  
  964. Additional note (THIS IS ONE OF THE BIG FEATURES OF JACOsub):
  965. Timings may overlap!  The software will handle overlapping text displays
  966. properly, but you must be sure to position your subtitles so that these
  967. separate text events do not physically overlap on the screen.  You can
  968. arrange timed lines in any order you want, separate overlapped events
  969. into groups, or whatever.  The program will handle it.
  970.  
  971.  
  972. 6.  CREDITS
  973. ===========
  974.  
  975. The original JACOsub format was dreamed up by Alex Matulich and Daric
  976. Koslowski, before any code was ever written for JACOsub.  Yes, this was the
  977. second step!  (The first was to create the fonts.)  Beta testers and users
  978. have been very helpful in expanding and improving the specification into
  979. what it is today.  User feedback has played a large role in the development
  980. of the software and the script format.  The entire JACOsub project has been
  981. largely user-driven.
  982.  
  983. End of JScripts.doc.
  984.